package com.example.demo.suanfa_2tree;

import org.junit.Test;

/**
 * 微软 折纸痕问题
 */
public class PaperFoldingDemo {


    public void paperFolding(int N){
        process(1, N, true);
    }

    private void process(int i, int n, boolean b) {
        if (i>n){
            return;
        }
        // 左
        process(i+1,n,true);
        // 中 boolean 决定当前 节点的 凹凸
        System.out.print(b?"凹 ": "凸 ");
        // 右
        process(i+1, n,false);
    }
    @Test
    public void test(){
        paperFolding(3);
    }

}
